import request from '@/utils/request'

export function getTeacherList() {
  return request({
    url: '/teachers/getAllTeachers',
    method: 'get'
  })
}

// FIXME：search 函数应该移到这里
export function searchTeacherByNameOrLevel(name, level) {
  return request({
    url: '/teachers/search',
    method: 'get',
    params: {
      'teacherName': name,
      'level': level
    }
  })
}
export function getLevels(){
  return request({
    url: '/teachers/getLevels',
    method:'get'
  })
}
export function getColleges(){
  return request({
    url:'/teachers/getColleges',
    method:'get'
  })
}
export function insertTeacher(params){
  return request({
    url: '/teachers/insertTeacher',
    method:'post',
    data: params
  })
}
export function deleteTeacherById(id){
  return request({
    url: '/teachers/deleteTeacher/'+id,
    method:'post',
  })
}
export function updateTeacher(params){
  return request({
    url:'/teachers/updateTeacher',
    method:'post',
    data: params
  })
}



